package com.yaoyong.codegenerator.entity;

import java.util.List;

/**
 * 数据库表实体模型
 *
 * @author 姚勇
 */
public class Table {

    /**
     * 表名称
     */
    private String name;
    /**
     * 表描述
     */
    private String comment = "";
    /**
     * 主键
     */
    private String key;

    /**
     * 列集合
     */
    private List<Column> columns;

    public String getName() {
        return name;
    }

    public Table setName(String name) {
        this.name = name;
        return this;
    }

    public String getComment() {
        return comment;
    }

    public Table setComment(String comment) {
        this.comment = comment;
        return this;
    }

    public String getKey() {
        return key;
    }

    public Table setKey(String key) {
        this.key = key;
        return this;
    }

    public List<Column> getColumns() {
        return columns;
    }

    public Table setColumns(List<Column> columns) {
        this.columns = columns;
        return this;
    }

    @Override
    public String toString() {
        return "Table{" +
                "name='" + name + '\'' +
                ", comment='" + comment + '\'' +
                ", key='" + key + '\'' +
                ", columns=" + columns +
                '}';
    }
}
